package org.mm.xml;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

import org.mm.xml.entities.TherapyXML;

/**
 * TherapyResponseXML
 *
 * @author Marco Traversari
 * @version $Revision: $ $Date: $ $Author: $
 */
@XmlRootElement(name = "response")
public class TherapyResponseXML extends PatientResponseXML {

	protected List<TherapyXML> therapies = null;

	/**
	 * getTherapies
	 * @return therapies
	 */
	@XmlElementWrapper(name = "therapies")
	@XmlElement(name = "therapy")
	public List<TherapyXML> getTherapies() {
		return therapies;
	}

	/**
	 * setTherapies
	 * @param therapies
	 */
	public void setTherapies(List<TherapyXML> therapies) {
		this.therapies = therapies;
	}

	/**
	 * addTherapy
	 * @param therapy
	 */
	public void addTherapy(TherapyXML therapy) {
		if (therapies == null) {
			therapies = new ArrayList<TherapyXML>();
		}
		therapies.add(therapy);
	}


	public void clear() {
		patient = null;
		therapies = null;
	}
}
